import request, { downloadFile } from '@/utils/request'

const api = {
  create:'/inspectionManagement/create',
  update:'/inspectionManagement/update',
  delete:'/inspectionManagement/delete',
  findBypage:'/inspectionManagement/findByPage',
  downLoad:'/inspectionManagement/export',
  importExcel:'/inspectionManagement/import',
}

export default api

// 新建
export function createinspection(parameter) {
  return request({
    url: api.create,
    method: 'post',
    data: parameter
  })
}
// 更新
export function updateinspection(parameter) {
  return request({
    url: api.update,
    method: 'post',
    data: parameter
  })
}
export function deleteinspection(parameter) {
  return request({
    url: api.delete+ '?id=' + parameter,
    method: 'post',
  })
}
// 查询
export function findBypageinspection(parameter) {
  return request({
    url: api.findBypage,
    method: 'get',
    params:parameter
  })
}
export function importExcelinspection(data,parameter) {
  return request({
    url: api.importExcel,
    method: 'post',
    data: data,
    params: parameter
  })
}
export function downloadinspection(parameter) {
  return downloadFile({
    url: api.downLoad,
    method: 'get',
    params: parameter
  })
}



